<form [formGroup]="formGroup">
    <div class="modal-header">
        <h4>修改帐号密码</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="onClose()">
            <span>&times;</span>
        </button>
    </div>

    <div class="modal-body">
        <mat-card>
            <div class="row">
                <div class="col">
                    <mat-form-field style="width: 100%">
                        <input matInput formControlName="login" type="text" placeholder="用户帐号">
                    </mat-form-field>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <mat-form-field style="width: 100%">
                        <input matInput formControlName="password" type="password" placeholder="新密码" (change)="confirmPassword.setValue('')">
                        <mat-error *ngIf="password.value && password.hasError('passwordStrong')">
                            {{password.errors.passwordStrong.value}}
                        </mat-error>
                    </mat-form-field>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <mat-form-field style="width: 100%">
                        <input matInput formControlName="confirmPassword" type="password" placeholder="再次输入新密码">
                        <mat-error *ngIf="confirmPassword.value && confirmPassword.hasError('passwordMatch')">
                            {{confirmPassword.errors.passwordMatch.value}}
                        </mat-error>
                    </mat-form-field>
                </div>
            </div>
        </mat-card>
    </div>
    <div class="modal-footer">
        <button mat-raised-button (click)="onClose()">
            <span class="fa fa-ban">&nbsp;取消</span>
        </button>
        <button mat-raised-button color="primary" (click)="onSubmit()" [disabled]="formGroup.invalid">
            <span class="fa fa-check-circle">&nbsp;更新</span>
        </button>
    </div>

</form>

